package homework.lottery;

import java.util.*;
import java.lang.*;
public class Lottery {

    public static void main(String[] args) {
        HashSet<Integer> list = new HashSet<>();
        Random random = new Random();

        while (list.size()<7){
            int readBall = random.nextInt(33)+1;
            list.add(readBall);
        }
        List<Integer> list1 = new ArrayList<>();
        list1.addAll(list);
        Collections.sort(list1, new Comparator<Integer>() {
            @Override
            public int compare(Integer integer, Integer t1) {
                return integer-t1;
            }
        });

        System.out.println("红球：");
        for (Integer i : list1) {
            System.out.print(i+"\t");
        }
        System.out.println();
        System.out.println("篮球：");
        int blueBall = random.nextInt(16)+1;
        System.out.println(blueBall);


    }
}
